﻿<UserControl x:Class="SensorDroneStudio.Views.SesnorView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:viewModels="clr-namespace:SensorDroneStudio.ViewModels"
             xmlns:oxy="http://oxyplot.codeplex.com"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="650"
            d:DataContext="{d:DesignInstance viewModels:SensorViewModel,IsDesignTimeCreatable=True}">
    <Grid>
        <Grid.Resources>
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></BooleanToVisibilityConverter>
        </Grid.Resources>
            <Grid.ColumnDefinitions>
                <ColumnDefinition MinWidth="200" Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="4*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <StackPanel HorizontalAlignment="Stretch" >
            <TextBlock FontSize="20" FontWeight="Bold" HorizontalAlignment="Center" Text="{Binding Path=Name}"></TextBlock>
            <TextBlock FontSize="60" HorizontalAlignment="Center" Text="{Binding Path=Value}"></TextBlock>
                <TextBlock FontSize="20" HorizontalAlignment="Center" Text="{Binding Path=Units}"></TextBlock>
            <ComboBox Visibility="{Binding Path=AlternateUnitsAvailable,Converter={StaticResource BooleanToVisibilityConverter}}" SelectedItem="{Binding Path=SelectedUnit}" ItemsSource="{Binding Path=AlternateUnits}" HorizontalContentAlignment="Stretch" FontSize="20"></ComboBox>
            </StackPanel>
        <oxy:Plot HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Background="{DynamicResource ControlBackgroundBrush}" Grid.Column="1" Model="{Binding Path=PlotModel.Model}"/>
    </Grid>
</UserControl>
